<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显示和隐藏</title>
    <style>
        * {margin: 0; padding: 0;}
        div {width: 200px; height: 200px;}
        .box1 {
            background-color: #bfa;
            /* 不占位, 直接隐藏, 会影响页面结构 */
            /* display: none; */
            /* 占位, 不影响页面结构 */
            visibility: visible;
            /* transition: linear 1s; */
        }

        .box1:hover {
            visibility: hidden;
        }
        .box2 {
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>